package bairui.international.controller.branch.branch.staff;

/**
 * @see bairui.international.controller.branch.branch.staff.AddSubPage_BaseFilter
 *
 */
class AddSubPage_Filter

{
	
	/**
	 * 过滤扩展接口
	 */
	static interface FilterExtends {
		com.querydsl.core.types.Predicate gainNickName(
			String nickName
		);
		com.querydsl.core.types.Predicate gainRealName(
			String realName
		);
		com.querydsl.core.types.Predicate gainPhone(
			String phone
		);
		com.querydsl.core.types.Predicate gainState(
			bairui.international.model.status.State_User state
		);
		com.querydsl.core.types.Predicate gainCreateTime_start(
			java.util.Date createTime
		);
		com.querydsl.core.types.Predicate gainCreateTime_end(
			java.util.Date createTime
		);
	}
	
	final static com.querydsl.core.BooleanBuilder query(
		bairui.international.model.domain.jpa.QTB_BranchCompanyStaff QRoot,
		javax.servlet.http.HttpServletRequest request
		,FilterExtends filterExtends
	) {
		com.querydsl.core.BooleanBuilder query = query(
				QRoot
			);
			/* comment 附加过滤属性 */
			if(null != request.getParameter("nickName")){
				query.and(filterExtends.gainNickName(
					com.sh_lianjing.string.util.Util_String.parseToType(
							request.getParameter("nickName"), 
							String.class, 
							"yyyy-MM-dd"
						)
				));
			}
			if(null != request.getParameter("realName")){
				query.and(filterExtends.gainRealName(
					com.sh_lianjing.string.util.Util_String.parseToType(
							request.getParameter("realName"), 
							String.class, 
							"yyyy-MM-dd"
						)
				));
			}
			if(null != request.getParameter("phone")){
				query.and(filterExtends.gainPhone(
					com.sh_lianjing.string.util.Util_String.parseToType(
							request.getParameter("phone"), 
							String.class, 
							"yyyy-MM-dd"
						)
				));
			}
			if(null != request.getParameter("state")){
				query.and(filterExtends.gainState(
					com.sh_lianjing.string.util.Util_String.parseToType(
							request.getParameter("state"), 
							bairui.international.model.status.State_User.class, 
							"yyyy-MM-dd"
						)
				));
			}
			if(null != request.getParameter("createTime_start")){
				query.and(filterExtends.gainCreateTime_start(
					com.sh_lianjing.string.util.Util_String.parseToType(
							request.getParameter("createTime_start"), 
							java.util.Date.class, 
							"yyyy-MM-dd"
						)
				));
			}
			if(null != request.getParameter("createTime_end")){
				query.and(filterExtends.gainCreateTime_end(
					com.sh_lianjing.string.util.Util_String.parseToType(
							request.getParameter("createTime_end"), 
							java.util.Date.class, 
							"yyyy-MM-dd"
						)
				));
			}
	;
		return query;
	}
	
	final static com.querydsl.core.BooleanBuilder query(
		bairui.international.model.domain.jpa.QTB_BranchCompanyStaff QRoot
	) {
		com.querydsl.core.BooleanBuilder builder = new com.querydsl.core.BooleanBuilder();
	
		return builder;
	}
	
}
